package com.metaverse.backend.service;

import com.metaverse.backend.domain.LiveGift;
import com.metaverse.backend.domain.LiveLike;
import com.metaverse.backend.dto.PageQuery;
import com.metaverse.backend.repo.LiveGiftRepo;
import com.metaverse.backend.repo.LiveLikeRepo;
import com.metaverse.backend.utils.JpaUtils;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

/**
 * 直播礼物数据
 */
@AllArgsConstructor
@Service
public class LiveGiftService {

    private LiveGiftRepo liveGiftRepo;


    /**
     * 分页数据
     * @param pageQuery
     * @return
     */
    public Page<LiveGift> all(PageQuery pageQuery) {
        return liveGiftRepo.findAll(JpaUtils.toSpecification(pageQuery, LiveGift.class),
                JpaUtils.toPageRequest(pageQuery));
    }



}
